/***2024-12-31 迷途小羔羊
* 用于编写塔防怪物ai
*/
namespace ghost
{
    export class TowerSmart extends MMOSmart
    {
        protected behaviorInit():void
        {
            let s = this;
			s.addBehaviors([BehaviorEnum.TOWER_ATTACK,BehaviorEnum.DETOUR])
        }
        public setBehavior(type:BehaviorEnum):void
        {            
            let s= this;            
            //塔防ai跟mmo不一样的地方，只是脱战或者巡逻的时候，塔防是走的线路行为，如果是我方人员则持续保持攻击            
            if(s._data.role._camp == CampType.CAMP_1)
                type = BehaviorEnum.TOWER_ATTACK;
            super.setBehavior(type);
        }
        /**怪物的新挂机智能*/
		public smart(t:number):void
		{            
			let s = this;
            let r:GameRole = s._data.role;
			if(r._isDead)return;
			if(r.inAirPos)return;
			// if(r._scene.hangupSmartPaused)return;			
			if(r.sts > StsType.RUN)
				return;			
            s.baseSmart(t);
			if(s._behaviorType > -1)return;			
			s.setBehavior(BehaviorEnum.TOWER_ATTACK);
		}  
        public behaviorOut(b: BehaviorBase, nextBehavior: BehaviorEnum): void 
		{			
			let s = this;
			if(nextBehavior == BehaviorEnum.TOWER_ATTACK)
				s.resetMMOSmartState();
			s.setBehavior(nextBehavior);
		}
    }
}